package com.rd.student.wulian.wanggaobo.day0731;

import java.util.ArrayList;
import java.util.Collections;

public class RandomNum01 {
    public static void main(String[] args) {

        ArrayList<Integer> numbers = new ArrayList<>();
        for (int i = 0; i < 50; i++) {
            numbers.add(i);
        }

        Collections.shuffle(numbers);


        ArrayList<Integer> randomNumbers = new ArrayList<>();
        for (int i = 0; i < 20; i++) {
            randomNumbers.add(numbers.get(i));
        }

        for (int i = 0; i < randomNumbers.size(); i++) {
            System.out.println(randomNumbers.get(i));
        }
    }
}